﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
using System.Data;

namespace ConfExpert.Forms.Depo.Kauf
{
    public partial class MagazaDagilimiZegna : XForm
    {
        string idxs = string.Empty;
        public MagazaDagilimiZegna(string idxs)
        {
            InitializeComponent();
            this.idxs = idxs;
        }

        private void MagazaDagilimiZegna_Load(object sender, EventArgs e)
        {
            
            gridView1.Init("GetOrdersMagazaKirilimli", idxs);
            gridView1.MakeColumnInvisible("idx");
            gridView1.MakeReadOnly("YikamaTalimatiDetay", "BedenEtiketi", "EkstraHangTag");
            bbiKaydet.ItemClick += bbiKaydet_ItemClick;

            foreach (DataRow r in gridView1.Dataset().Tables[1].Rows)
            {
                gridView1.FormatAsNumber(0, r[0].ToStr());
                gridView1.AddSummary(r[0].ToStr());
            }
            gridView1.BestFitColumns();
        }

        void bbiKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.EndEditing();
            gridView1.Update("idx,YikamaTalimatiDetay,BedenEtiketi,EkstraHangTag", "KaufOrdersMagaza");
            gridView1.BestFitColumns();
        }
    }
}
